<template>

		<div class="mui-numbox" data-numbox-min='1' :data-numbox-max='max'>
			<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
			<input id="test" class="mui-input-numbox" type="number" value="1" @change="getCount1" ref="num"/>
			<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
		</div>

</template>

<script>
	import mui from '../../mui/js/mui.min.js'
	export default{
		mounted() {
			mui(".mui-numbox").numbox()
			// console.log(this.max)
		},
		methods:{
			getCount1(){
				// console.log(this.$refs.num.value )
				this.$emit('getCount',parseInt(this.$refs.num.value) )
			}
		},
		props:['max'],
		watch:{
			max:function(new1,old1){
					mui(".mui-numbox").numbox().setOption("max",new1)
			}
		}
		
	}
</script>

<style>
</style>
